﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="edit.aspx.cs"  validateRequest="false" Inherits="Web.admin.news.edit" Debug="true" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link href="../../css/style.css" rel="stylesheet" type="text/css" />
    <script src="../../js/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="../../js/jquery.validate.min.js" type="text/javascript"></script>
    <script src="../../tool/editor/kindeditor.js" type="text/javascript"></script>
    <script src="../../tool/editor/lang/zh_CN.js" type="text/javascript"></script>
    <script src="../../js/jquery.form.js" type="text/javascript"></script>
    <script src="../../js/function.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $(".txtInput_upload").val("");
        })
        var editor;
        KindEditor.ready(function (K) {
            editor = K.create('#KindEditor', {
                width: '750px', height: '330px',
                uploadJson: '../../tool/editor/asp.net/upload_json.ashx',
                fileManagerJson: '../../tool/editor/asp.net/file_manager_json.ashx',
                allowFileManager: true
            });
        });
        $(function () {
            $("#Cb_url").bind("click", function () {
                if ($(this).attr("checked") == true) {
                    $(".upordown").show();
                } else {
                    $(".upordown").hide();
                }
            });
        });
    </script>
    <script type="text/javascript" language="javascript">
        function CheckEmpty() {
            if ($(".txtInput1").val() == "") {
                alert("标题名称为必填项，不能为空！");

                return false
            }
            else
                return true;
        }
        function ClearToEmpty() {
            if ($(".txtInput1").val("") && $(".txtInput2").val(""))
                return false;
        }
     </script>
    <style type="text/css">
        .style1
        {
            width: 74px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div class="top_div">
        <div class="top_div_left" >
                <table>
                    <tr >
                        <td ><img src="../../images/main_hl.gif" alt="" /></td>
                        <td ><img src="../../images/main_hl2.gif" alt="" /></td>
                        <td class="topNav"><span>信息编辑</span></td>
                        <td><img src="../../images/main_hr.gif" alt="" /></td>
                    </tr>
                </table>
        </div>
    </div>
    <div class="middle_div">
        <div class="middle_left"></div>
        <div class="middle_middle">
            <div class="navigation">首页&gt;信息发布&gt;信息编辑
            <div style="float:right; margin-right:5px;">
                    <a href="list.aspx">返回信息编辑列表>></a>
                </div>
            </div>
            <div class="submitTable">
                <table>
                <tr><th class="style1">所属类别:</th><td><asp:DropDownList ID="DDLClass" CssClass="ddlList" runat="server"></asp:DropDownList></td></tr>
                <tr><th class="style1">标题名称：</th><td><input type="text" id="TitleTxt" runat="server" class="txtInput1"/><label>*</label></td></tr>
                <tr><th class="style1">信息来源：</th><td><input type="text" id="FromTxt" runat="server" class="txtInput2" /></td></tr>
                <tr><th class="style1">可选类型：</th><td><asp:CheckBox runat="server" ID="Cb_url" Text="图片链接"/></td></tr>
                <tr class="upordown" style="display:none;">
                    <th class="style1">添加图片：</th>
                    <td>
                         <input type="text" runat="server" id="txtImgUrl" class="txtInput txtInput_upload" style="padding:0px;" />
                         <a href="javascript:void(0);" class="files">
                            <input type="file" id="FileUpload" name="FileUpload" onchange="SingleUpload('txtImgUrl','FileUpload')" />
                        </a>
                         <span class="uploading">正在上传，请稍候...</span>
                    </td>
                </tr>
                <tr><th class="style1">新闻内容：</th><td><asp:TextBox  ID="KindEditor" TextMode="MultiLine" runat="server"></asp:TextBox></td></tr>
                <tr>
                    <th class="style1">信息属性：</th>
                    <td>
                        <asp:DropDownList ID="AttributeDDL" CssClass="ddlList" runat="server">
                            <asp:ListItem Value="True">未审核</asp:ListItem>
                            <asp:ListItem Value="False">已审核</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td> 
                           &nbsp;</td>
                    <td> 
                    <asp:Button ID="btn_reset" OnClientClick="return ClearToEmpty();" Text="重置" 
                            CssClass="btn_submit" runat="server" Height="32px" Width="71px" />
             
                           <asp:Button ID="btn_Save" OnClientClick="return CheckEmpty();" Text="保存" CssClass="btn_submit"  
                            OnClick = "btn_Save_Click" runat="server" Height="32px" Width="71px" />
             
                    </td>
                </tr>
                </table>
            </div>
        </div>
        <div class="middle_right"></div>
    </div>
    </form>
</body>
</html>